﻿using System.Threading.Tasks;
using SmartCity.Shared;
using Volo.Abp.Application.Services;

namespace ParkManagement
{
    /// <summary>
    /// 挪车应用服务类
    /// </summary>
    public class MoveAppService : ApplicationService, IMoveAppService
    {
        private readonly MoveManager _moveManager;

        public MoveAppService(
            MoveManager moveManager)
        {
            _moveManager = moveManager;
        }

        // 创建
        public async Task<ResultResponse<MoveDto>> CreateAsync(CreateMoveDto input)
        {
            var move = await _moveManager.CreateAsync(
                input.PlateNo,
                input.Photo,
                input.IdCard,
                input.Tel,
                input.Province,
                input.City,
                input.Area,
                input.Address);
            var dto = ObjectMapper.Map<Move, MoveDto>(move);
            return ResultResponse<MoveDto>.Successful(dto);
        }
    }
}